import { Navigate, createBrowserRouter } from 'react-router-dom'
import Layout from '../view/Layout'
import Home from '../view/Home'
import Knowledge from '../view/Knowledge'
import Message from '../view/Message'
import Mine from '../view/Mine'
import Setting from '../view/Setting'
import Resetname from '../view/Resetname'
import Resetphone from '../view/Resetphone'
import Resetpsd from '../view/Resetpsd'
import Concern from '../view/Concern'
import Collect from '../view/Collect'
import ArticleDetail from '../view/ArticleDetail'
import Coupon from '../view/Coupon'
import Score from '../view/Score'
import Serve1 from '../view/Serve1'
import Serve2 from '../view/Serve2'
import Serve3 from '../view/Serve3'
import Serve4 from '../view/Serve4'
import File from '../view/File'
import Record from '../view/Record'
const router = createBrowserRouter([
    {
        path: '/layout', element: <Layout />, children: [
            { path: '/layout/home', element: <Home /> },
            { path: '/layout/knowledge', element: <Knowledge /> },
            { path: '/layout/message', element: <Message /> },
            { path: '/layout/mine', element: <Mine /> },
            { path: '/layout/setting', element: <Setting /> },
            { path: '/layout', element: <Navigate to='/layout/home' /> },
        ]
    },
    { path: '/setting', element: <Setting /> },
    { path: '/resetname', element: <Resetname /> },
    { path: '/resetphone', element: <Resetphone /> },
    { path: '/resetpsd', element: <Resetpsd /> },
    { path: '/concern', element: <Concern /> },
    { path: '/collect', element: <Collect /> },
    { path: '/articleDetail', element: <ArticleDetail /> },
    { path: '/coupon', element: <Coupon /> },
    { path: '/score', element: <Score /> },
    { path: '/serve1', element: <Serve1 /> },
    { path: '/serve2', element: <Serve2 /> },
    { path: '/serve3', element: <Serve3 /> },
    { path: '/serve4', element: <Serve4 /> },
    { path: '/file', element: <File /> },
    { path: '/record', element: <Record /> },
    { path: '/*', element: <Navigate to='/layout' /> }
])
export default router